# build stage
FROM node:10.16.0-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN yarn config set registry https://registry.npm.taobao.org/
RUN yarn
COPY . .
RUN npm run build

# Production stage
FROM nginx:1.16.1-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY --from=build-stage /app/nginx-site.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD [ "nginx", "-g", "daemon off;"]